const db = wx.cloud.database();
// pages/shoucang/shoucang.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
	userInfo: {},
	shoucang_List: []
  },
  onShow(){
	const userInfo = wx.getStorageSync("userInfo");
	if(!userInfo){
		wx.showToast({
			title:'请先登录',
			icon:'none',
			mask:true
		})
	return;	
	}else{
		this.setData({
			userInfo
		})
		this.getGoodsShoucang();
	}
  },
  async getGoodsShoucang(){
	const result = await db.collection('goods_detail_shoucang').where({})
		.get()
		.then((res) => {
			this.setData({
				shoucang_List: res.data
			})
		})
}
})